module type X = sig
  val x: int
end

module type Y = sig
  val y: int
end

module IncX(M: X) = struct
  let x = M.x + 1
end

(* 匿名 functor  *)
module IncXX = functor (M: X) (T: Y) -> struct
                 let x = M.x + 2
                 let y = T.y + 3
               end

module A = struct let x = 0 end
module B = IncX(A)
module C = IncX(B)

;;
assert (A.x = 0);;
assert (B.x = 1);;
assert (C.x = 2)
